package cn.com.dcsgo.domain.vo;

import cn.com.dcsgo.config.validation.UserLoginByEmail;
import cn.com.dcsgo.config.validation.UserLoginByPhone;
import cn.com.dcsgo.config.validation.UserLoginByUsername;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

/**
 * UserLoginVo
 *
 * @author Dcsgo
 * @since 2025/4/3 10:45
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel("用户登录对象")
public class UserLoginVo {
    @NotBlank(groups = {UserLoginByPhone.class, UserLoginByEmail.class, UserLoginByUsername.class})
    @ApiModelProperty("密码")
    private String password;

    @ApiModelProperty("用户名")
    @NotBlank(groups = {UserLoginByUsername.class})
    private String username;

    @Email(groups = {UserLoginByEmail.class})
    @NotBlank(groups = {UserLoginByEmail.class})
    @ApiModelProperty("邮箱")
    private String email;

    @ApiModelProperty("手机号")
    @NotBlank(groups = {UserLoginByPhone.class})
    @Size(min = 11, max = 11, groups = {UserLoginByPhone.class})
    private String phone;
}
